package com.ruoyi.web.controller.byhealth;


import com.ruoyi.by.health.domain.entity.EmployeeMessageWall;
import com.ruoyi.by.health.domain.form.MessageWallForm;
import com.ruoyi.by.health.domain.vo.EmployeeGameVo;
import com.ruoyi.by.health.service.IEmployeeMessageWallService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 留言墙管理
 *
 * @author zhangjq
 */
@Api(value = "留言墙管理",tags = "留言墙管理")
@RestController
@RequestMapping("/byhealth/employee/message")
public class EmployeeMessageController extends BaseController {
    @Autowired
    private IEmployeeMessageWallService messageService;
    /**
     * 获取用户列表
     */
    @ApiOperation("获取留言墙列表")
    @PreAuthorize("@ss.hasPermi('byhealth:employee:list')")
    @GetMapping("/list")
    public List<EmployeeMessageWall> list(EmployeeMessageWall massage) {
        List<EmployeeMessageWall> list = messageService.selectEmployeeGameScoreList(massage);
        return list;
    }

    /**
     * 获取用户列表
     */
    @ApiOperation("获取留言墙列表-分页")
    @PreAuthorize("@ss.hasPermi('byhealth:employee:list')")
    @GetMapping("/page")
    public TableDataInfo page(EmployeeMessageWall emp) {
        startPage();
        List<EmployeeMessageWall> list = messageService.selectEmployeeGameScoreList(emp);
        return getDataTable(list);
    }

    @ApiOperation("留言墙审核")
     @PreAuthorize("@ss.hasPermi('byhealth:employee:game')")
    @PostMapping("/audit")
    public AjaxResult gameScore(@RequestBody MessageWallForm messageWallForm) {
         messageService.auditMessage(messageWallForm);
        return AjaxResult.success("审核成功");
    }



}
